import React from 'react'
import {List} from "antd";
import ProductInfo from "@/pages/Home/component/ProductList/component/ProductInfo";
import {connect} from "umi";

const ProductList = (props: any) => {
  const { productList } = props.products
  return (
    <div className="w-full pb-5">
      <div className="title">{productList?.length | 0} Product(s) found</div>
      <div className="flex">
        <List
          className="w-full"
          grid={{
            gutter: 20,
            column: 4
          }}
          loading={productList ? false : true}
          split={false}
          bordered={false}
          dataSource={productList}
          renderItem={(item: any) => <ProductInfo {...item}/> }
        />
      </div>
    </div>
  )
}
export default connect(({products}: any)=> ({products}))(ProductList) ;
